package cn.scau.server.controller;

import cn.scau.server.dto.MobileLoginFormDTO;
import cn.scau.server.service.MobileUserService;
import cn.scau.server.vo.ResultVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/mobileUser")
public class MobileUserController {
    @Autowired
    private MobileUserService mobileUserService;

    @ApiOperation("移动端登录")
    @PostMapping("/login")
    public ResultVO mobileLogin(@RequestBody MobileLoginFormDTO loginForm){
        return mobileUserService.login(loginForm);
    }

    @ApiOperation("数据存储")
    @GetMapping("/getUserInfo")
    public ResultVO getUserInfo(@RequestParam String empId, HttpServletRequest request){
        return mobileUserService.getUserInfo(empId,request);
    }
}
